package com.llstudio.creation.factory;

class RuleConfigParserFactory {

    public static RuleConfigParser createParser(String ruleConfigFileExtension) {
        RuleConfigParser parser;

        if (ruleConfigFileExtension.equalsIgnoreCase("json")) {
            parser = new JsonRuleConfigParser();
        } else if (ruleConfigFileExtension.equalsIgnoreCase("xml")) {
            parser = new XmlRuleConfigParser();
        } else {
            throw new RuntimeException("Rule config file format is not supported");
        }
        return parser;
    }
}
